﻿using PDFDesign.Model.Const;
using System;
using System.Globalization;
using System.Windows.Data;

namespace PDFDesign.Converter
{
    class FontNameConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var fontName = FontName.normal;
            Enum.TryParse(value.ToString(), out fontName);
            return fontName;
        }
    }
}
